import request from './request'

// 接口
//获取验证码
export const validCode = () => request.get('/validCode');

// 登录
export const login = (data) => request.post('/login', data);

// 注册
export const register = (data) => request.put('/register', data);

//上传收货地址
export const addr = data => request.put('/addr', data);

//获取收货地址
export const getAddr = () => request.get('/addr');

//删除
export const delAddr = data => request.delete('/addr',{params:data});

//修改
export const Modify = data => request.post('/addr',data);

//默认地址
export const isSet = data => request.post('/defaultAddr',data);

//获取商品
export const prod = data => request.get('/prod',{params:data});

//获取轮播图
export const banner = data => request.get('/banner',{params:data});

//获取秒杀数据
export const secKill = data => request.get('/secKill',{params:data});

//添加商品到购物车
export const addTo = data => request.put('/cart', data);

//删除购物车的商品
export const DeleteGoods = data => request.post('/delcart ', data);

//更新购物车的商品数量
export const update = data => request.post('/cart',data);

//获取购物车的商品
export const obtain = data => request.get('/cart', {params:data});

//支付接口
export const PAY = data => request.post('/pay', data);

//创建订单
export const create = data => request.put('/order', data);

//商品搜索
export const search = data => request.get('/searchProd', {params:data});

//获取购物车的商品数量
export const count = data => request.get('/cartCount ', {params:data});
